3.3.31 \(\int \frac {a+a \sin (e+f x)}{c-c \sin (e+f x)} \, dx\) [231]

Optimal. Leaf size=33 \[ -\frac {a x}{c}+\frac {2 a \cos (e+f x)}{f (c-c \sin (e+f x))} \]

[Out]

-a*x/c+2*a*cos(f*x+e)/f/(c-c*sin(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {2814, 2727} \begin {gather*} \frac {2 a \cos (e+f x)}{f (c-c \sin (e+f x))}-\frac {a x}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])/(c - c*Sin[e + f*x]),x]

[Out]

-((a*x)/c) + (2*a*Cos[e + f*x])/(f*(c - c*Sin[e + f*x]))

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rubi steps

\begin {align*} \int \frac {a+a \sin (e+f x)}{c-c \sin (e+f x)} \, dx &=-\frac {a x}{c}+(2 a) \int \frac {1}{c-c \sin (e+f x)} \, dx\\ &=-\frac {a x}{c}+\frac {2 a \cos (e+f x)}{f (c-c \sin (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(83\) vs. \(2(33)=66\).
time = 0.13, size = 83, normalized size = 2.52 \begin {gather*} \frac {a \left (-f x \cos \left (\frac {f x}{2}\right )+4 \sin \left (\frac {f x}{2}\right )+f x \sin \left (e+\frac {f x}{2}\right )\right )}{c f \left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])/(c - c*Sin[e + f*x]),x]

[Out]

(a*(-(f*x*Cos[(f*x)/2]) + 4*Sin[(f*x)/2] + f*x*Sin[e + (f*x)/2]))/(c*f*(Cos[e/2] - Sin[e/2])*(Cos[(e + f*x)/2]
 - Sin[(e + f*x)/2]))

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 38, normalized size = 1.15

method result size
risch \(-\frac {a x}{c}+\frac {4 a}{f c \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}\) \(32\)
derivativedivides \(\frac {2 a \left (-\frac {2}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}-\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f c}\) \(38\)
default \(\frac {2 a \left (-\frac {2}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}-\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f c}\) \(38\)
norman \(\frac {\frac {a x}{c}+\frac {a x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}-\frac {4 a}{c f}-\frac {a x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{c}-\frac {a x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c}-\frac {4 a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}\) \(117\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))/(c-c*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2/f*a/c*(-2/(tan(1/2*f*x+1/2*e)-1)-arctan(tan(1/2*f*x+1/2*e)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (36) = 72\).
time = 0.49, size = 88, normalized size = 2.67 \begin {gather*} -\frac {2 \, {\left (a {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{c} - \frac {1}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} - \frac {a}{c - \frac {c \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))/(c-c*sin(f*x+e)),x, algorithm="maxima")

[Out]

-2*(a*(arctan(sin(f*x + e)/(cos(f*x + e) + 1))/c - 1/(c - c*sin(f*x + e)/(cos(f*x + e) + 1))) - a/(c - c*sin(f
*x + e)/(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [A]
time = 0.33, size = 70, normalized size = 2.12 \begin {gather*} -\frac {a f x + {\left (a f x - 2 \, a\right )} \cos \left (f x + e\right ) - {\left (a f x + 2 \, a\right )} \sin \left (f x + e\right ) - 2 \, a}{c f \cos \left (f x + e\right ) - c f \sin \left (f x + e\right ) + c f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))/(c-c*sin(f*x+e)),x, algorithm="fricas")

[Out]

-(a*f*x + (a*f*x - 2*a)*cos(f*x + e) - (a*f*x + 2*a)*sin(f*x + e) - 2*a)/(c*f*cos(f*x + e) - c*f*sin(f*x + e)
+ c*f)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (26) = 52\).
time = 0.66, size = 88, normalized size = 2.67 \begin {gather*} \begin {cases} - \frac {a f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{c f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - c f} + \frac {a f x}{c f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - c f} - \frac {4 a}{c f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - c f} & \text {for}\: f \neq 0 \\\frac {x \left (a \sin {\left (e \right )} + a\right )}{- c \sin {\left (e \right )} + c} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))/(c-c*sin(f*x+e)),x)

[Out]

Piecewise((-a*f*x*tan(e/2 + f*x/2)/(c*f*tan(e/2 + f*x/2) - c*f) + a*f*x/(c*f*tan(e/2 + f*x/2) - c*f) - 4*a/(c*
f*tan(e/2 + f*x/2) - c*f), Ne(f, 0)), (x*(a*sin(e) + a)/(-c*sin(e) + c), True))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 37, normalized size = 1.12 \begin {gather*} -\frac {\frac {{\left (f x + e\right )} a}{c} + \frac {4 \, a}{c {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))/(c-c*sin(f*x+e)),x, algorithm="giac")

[Out]

-((f*x + e)*a/c + 4*a/(c*(tan(1/2*f*x + 1/2*e) - 1)))/f

________________________________________________________________________________________

Mupad [B]
time = 6.81, size = 46, normalized size = 1.39 \begin {gather*} -\frac {a\,x}{c}-\frac {a\,\left (e+f\,x\right )-a\,\left (e+f\,x-4\right )}{c\,f\,\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sin(e + f*x))/(c - c*sin(e + f*x)),x)

[Out]

- (a*x)/c - (a*(e + f*x) - a*(e + f*x - 4))/(c*f*(tan(e/2 + (f*x)/2) - 1))

________________________________________________________________________________________